package cn.dbqn.controller;

import cn.dbqn.entity.Henhouse;
import cn.dbqn.service.HenhouseService;
import com.sun.org.apache.xpath.internal.operations.Mod;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class HenhouseController {
    @Resource
    HenhouseService henhouseService;

    @RequestMapping("/listjs")
    public String list(Model model){
        List<Henhouse> list=henhouseService.findAllJs();
        model.addAttribute("list",list);
        return "lyear_ui_icons";
    }

    @ResponseBody
    @RequestMapping("jsxx")
    public Object jsxx(@RequestParam("hno")Integer hno){
        Henhouse jsxx=henhouseService.jsxx(hno);
        return jsxx;
    }
}
